package com.lmax.disruptor.custom.group;

import com.lmax.disruptor.EventTranslator;
import com.lmax.disruptor.custom.demo.Trade;

import java.util.Random;

class TradeEventTranslator implements EventTranslator<Trade>
{

    private final Random random = new Random();

    @Override
    public void translateTo(final Trade trade, final long arg1)
    {
        this.generateTrade(trade);
    }

    private Trade generateTrade(final Trade trade)
    {
//        trade.setPrice(random.nextDouble() * 9999);
        return trade;
    }
}